const express = require('express')
const router = express.Router()
const categoryController = require('../controller/categoryController')
const articleController = require('../controller/articleController')

// 分类路由
router.get('/category/index', categoryController.index)
router.post('/category/add', categoryController.add)
router.put('/category/update', categoryController.update)
router.delete('/category/delete', categoryController.delete)
router.get('/category/search', categoryController.search)

// 文章路由
router.get('/article/index', articleController.index)
router.get(
  '/article/test',
  // 中间件
  function (req, req, next) {
    console.log('router')
    next()
  },
  articleController.test
)
module.exports = router
